You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(terminal): package desktop sidecars and embedded native libraries - #2138
Apps importing base/terminal now ship libghostty-vt beside Windows/Linux executables, in arm64 AARs, and as a companion GhosttyVT.xcframework beside static or dynamic embedded iOS frameworks. The companion includes device arm64, simulator arm64/x86_64 and Catalyst arm64/x86_64; hosts embed and sign it. Catalyst library discovery follows the host’s Contents/Frameworks layout.
The generator adds the missing Apple prebuilds and a selective -target rebuild flag. Public English/Chinese docs, the agent skill and the terminal roadmap describe host setup and remaining gaps.
Refs #1454. Keep the issue open for the Android prerequisite and real Android embedding-host acceptance.
Verification
go tool nsgo check -target macos,ios,windows,linux,android,web,tvos,watchos -jobs 4: all selected target architectures passed.
Focused packaging, bundle discovery, generator selection, Apple minimum, layering, skills, duplicate-change and changelog tests passed.
Real Linux and Windows packages executed with isolated empty caches: public Terminal.New/Feed/Text consumed ANSI output, LibraryPath selected the packaged sidecar, and no embedded fallback was extracted. Windows ran on a host without Go.
Built complete static and dynamic iOS XCFramework packages. The opt-in companion test verified all five architecture slices, framework signatures and omission for apps without the terminal.
The existing Swift embedding host, unchanged, rendered two terminal views in an owned iOS 27 simulator for both static and dynamic app frameworks. Logs showed Host.app/Frameworks/GhosttyVT.framework/GhosttyVT; screenshots were inspected. The unchanged host also ran on Mac Catalyst and loaded Host.app/Contents/Frameworks/GhosttyVT.framework/GhosttyVT.
Real arm64 AAR builds included byte-identical jni/arm64-v8a/libghostty-vt.so for terminal apps and omitted it otherwise.
Prerequisites and limits
The native Apple host runs used only the safe-area registration hunks from unmerged #2119 in an isolated verification copy: baseline main otherwise panics before terminal startup because NsgoSurface registers safeAreaInsetsDidChange twice. This PR does not duplicate that fix. Static/dynamic artifact builds and companion tests pass without the overlay.
The AAR test used the verification-only Android arm64 prebuild from #2139 (Android support for #1452), head 055e6fcb90d231fc29c541029b512af075c8b83f, SHA-256 e4ffd6c8c2fdab2998931025e427e134c95871f5b51a9f76540eba4cee4d4d5f. Neither that Android binary nor its loader is duplicated here. #2139 must merge before a terminal AAR is usable. This test proves the AAR payload, not Android runtime/device acceptance. Android x86_64 has no terminal prebuild. Physical iOS hosts and Intel execution were not exercised; their framework slices were built and inspected.
Reviewed. Checked that every packaging path asks go list -deps whether the app links base/terminal/internal/library for that exact target, that desktop sidecars are validated against the target before copying, that the companion XCFramework is rebuilt (or removed) on each embed build and has no app headers, and that Catalyst discovery looks in Contents/Frameworks.
One fix pushed: the repository has no lib/android-* prebuild yet (#1452), so androidGhosttyFile failed every -embed AAR build of an app that links the terminal with "read Android libghostty-vt". A missing prebuild now leaves the AAR without it, as before this PR (APKs already behave that way); a present one is still packed into jni/<abi>/. Also rebased (roadmap conflict) and unwrapped the comment paragraphs touched. vet and the library, tool and cmd/nsgo packaging tests pass on Linux; the opt-in native package tests were not rerun.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apps importing
base/terminalnow ship libghostty-vt beside Windows/Linux executables, in arm64 AARs, and as a companionGhosttyVT.xcframeworkbeside static or dynamic embedded iOS frameworks. The companion includes device arm64, simulator arm64/x86_64 and Catalyst arm64/x86_64; hosts embed and sign it. Catalyst library discovery follows the host’sContents/Frameworkslayout.The generator adds the missing Apple prebuilds and a selective
-targetrebuild flag. Public English/Chinese docs, the agent skill and the terminal roadmap describe host setup and remaining gaps.Refs #1454. Keep the issue open for the Android prerequisite and real Android embedding-host acceptance.
Verification
go tool nsgo check -target macos,ios,windows,linux,android,web,tvos,watchos -jobs 4: all selected target architectures passed.Terminal.New/Feed/Textconsumed ANSI output,LibraryPathselected the packaged sidecar, and no embedded fallback was extracted. Windows ran on a host without Go.Host.app/Frameworks/GhosttyVT.framework/GhosttyVT; screenshots were inspected. The unchanged host also ran on Mac Catalyst and loadedHost.app/Contents/Frameworks/GhosttyVT.framework/GhosttyVT.jni/arm64-v8a/libghostty-vt.sofor terminal apps and omitted it otherwise.Prerequisites and limits
The native Apple host runs used only the safe-area registration hunks from unmerged #2119 in an isolated verification copy: baseline main otherwise panics before terminal startup because
NsgoSurfaceregisterssafeAreaInsetsDidChangetwice. This PR does not duplicate that fix. Static/dynamic artifact builds and companion tests pass without the overlay.The AAR test used the verification-only Android arm64 prebuild from #2139 (Android support for #1452), head
055e6fcb90d231fc29c541029b512af075c8b83f, SHA-256e4ffd6c8c2fdab2998931025e427e134c95871f5b51a9f76540eba4cee4d4d5f. Neither that Android binary nor its loader is duplicated here. #2139 must merge before a terminal AAR is usable. This test proves the AAR payload, not Android runtime/device acceptance. Android x86_64 has no terminal prebuild. Physical iOS hosts and Intel execution were not exercised; their framework slices were built and inspected.